<style scoped>
.time {
  font-size: 14px;
}

.content {
  font-weight: bold;
  padding-left: 5px;
}

.input-with-select .el-input-group__prepend {
  background-color: #fff;
}

.crud-opts {
  padding: 6px 0;
  display: -webkit-flex;
  display: flex;
  align-items: center;
}

.crud-opts .crud-opts-right {
  margin-left: auto;
}

</style>

<template>
  <div class="app-container">
    <el-card class="box-card" v-if="crud.optPageShow.listPage">
      <div slot="header" class="clearfix">
        <span>分发器线程列表</span>
      </div>
      <!--工具栏-->
      <div class="head-container" style="margin-top: 5px">
        <crud-operation/>
      </div>
      <!--表格渲染-->
      <el-table v-loading="crud.loading" ref="table" :data="crud.data" style="width: 100%;"
                @select="crud.selectChange" @select-all="crud.selectAllChange"
                @selection-change="crud.selectionChangeHandler"
                :header-cell-style="{ background: 'rgba(52, 125, 225, 0.1)', color: '#404248' }" border stripe>
        <el-table-column
          v-if="columns.visible('threadName')"
          :show-overflow-tooltip="true"
          label="线程名"
          prop="threadName"
        />
        <el-table-column
          v-if="columns.visible('groupCode')"
          :show-overflow-tooltip="true"
          label="应用组编码"
          prop="groupCode"
        />
        <el-table-column
          v-if="columns.visible('stop')"
          :show-overflow-tooltip="true"
          label="线程暂停"
          prop="stop"
        />
        <el-table-column
          v-if="columns.visible('run')"
          :show-overflow-tooltip="true"
          label="线程是否跑数据"
          prop="run"
        />
        <el-table-column
          v-if="columns.visible('runningFlag')"
          :show-overflow-tooltip="true"
          label="任务是否在处理"
          prop="runningFlag"
        />
      </el-table>
    </el-card>
  </div>
</template>
<script>
import CRUD, {presenter, header, form, crud} from '@crud/crud'
import crudOperation from "@crud/extend/components/CRUD.OnlyLookOperation"

const queryList = [
  {cloumValue: "threadName", cloumName: "线程名"},
  {cloumValue: "groupCode", cloumName: "应用组编码"}
];

//默认去查询
const defaultCrud = CRUD({
  title: '待执行队列', url: 'api/ram/qryDisThread',
  sort: 'sort,asc', queryList: queryList
})
const defaultForm = {}

export default {
  name: 'toDo',
  components: {crudOperation},
  mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
  dicts: ["cycle_job_status", "task_status", "task_track_type"],
  props: {},
  data() {
    return {}
  },
  methods: {
    taskStatusFormatter(row, column) {
      return this.dict.label.task_status[row.taskStatus];
    },
    formatterType(type) {
      return this.dict.label.task_track_type[type];
    }
  }
}
</script>
